home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-10-14 | 9.8 KB | 253 lines | [TEXT/MPS ] |
- --------------------------------------------------
- MT2ToolKit, version 1.0b1
- (C) Copyright by Michael Trofimov, 10/6/95.
- --------------------------------------------------
-
- MT2ToolKit version 1.0b1 is tool kit for MPW Pascal programmers. It makes easier
- a variety of permanent programming jobs and so, it's capable to save your time
- and efforts, and, perhaps, to preserve against some simple, but wide-distributed
- bugs.
-
- This version of the kit supports checking up and marking Pascal sources,
- additional opportunities for navigation within the source, and even
- automatical-writing a program from scratch!
-
- NOTE: This is beta-version! (Some restrictions had been fixed already.) But in
- the near future, updated version will be ready. Be sure to connect with the
- author directly via network:
-
- mtrofimov@glas.apc.org
-
- to get the next version as soon as possible. The next version will be extended
- by new tools and scripts (see 'Other MT2 software' file). To do this work
- faster and better, author needs your comments!
-
- This version of MT2ToolKit was implemented and tested
- under MPW Shell 3.3.1, © Apple Computer, Inc.
-
-
- MT2ToolKit version 1.0b1 contains :
-
- Read.Me! # this file
- 'About MT2ToolKit' # picture, which shows how to find MT2ToolKit items
- # in menus of MPW shell
- 'Other MT2 software' # other software by this author
- NewItems.Help # help file
- UserStartup•MT2ToolKit # MPW startup file
- CheckPasSyntax # script to check Pascal syntax in active/target window
- Gener # script to generate pattern for an array initialization
- MarkSour2 # script to mark procedure/function names in active/target window
- PascalMenu # script to add Pascal menu
- PasteData # script to replace {%%} markers with values from data file
- Signature # script to type user's copyright string
- :Trivial: # folder, there are Trivial tool and its patterns,
- # to generate Pascal source from resource description file;
- # also there is Example folder
-
- Usage is very simple : you need not remember names of new commands -- some of
- them will be added to MPW menu during MPW Shell start up, the others you can add
- (and remove) by selecting of the menu items. (See picture in 'About MT2ToolKit'
- file).Also, Trivial and Gener have resources to support Commando dialog. To get
- info about each command, you will find new items in Help menu.
-
- Also, short descriptions and a few examples are followed here.
-
- • Pascal menu
- • Delete the menu
-
- Use this items to add (remove) Pascal menu. (Note: the Pascal menu help item
- will be added (removed) synchronously. See 'About MT2ToolKit' picture, as well.)
- Be sure to modify UserStartup•MT2ToolKit, if you want that the Pascal menu would
- be added any time MPW Shell is running, but if your Mac has small screen and
- sometime you need to add another menus to MPW menu bar, Pascal menu deletion
- may be necessary.
-
- • Rotate Windows
-
- implements RotateWindows MPW command in menu.
-
- • Signature
-
- Select this item in Edit menu to insert copyright string to current position of
- a text. For example:
-
- (C) Copyright by Michael Trofimov, 10/6/95.
-
- (See UserStartup•MT2ToolKit file to set your name for generation of this string).
-
- • Check syntax
-
- Select this menu item when you want to check up syntax of your program in
- current window. Errors report will be directed to MPW Worksheet window, the
- first line of the report will be selected, no object code will be generated. In
- the case, when no error has been found, an alert box with corresponded message
- opens.
-
- • Match delimiters
-
- This item makes more handle MPW MatchIt command. Select first bracket in your
- source (for example, BEGIN key word) and select this item -- the matched END
- will be found (selected).
-
- • Mark source
-
- makes more handle MPW marking (Mark, Unmark, Browse). To mark new program or
- remark modified program, which was marked before, select this item when the
- program is in active window.
-
- • Add %%-marker
-
- inserts special characters marker (%%-marker):
-
- {%%}
-
- to selected position in the source text. You can use these markers to mark any
- places in the program. The NextMarker and PredMarker commands will find next and
- pred. %%-markers respectively. These markers also may be generated by Gener and
- Trivial commands.
-
- NOTE: the comment:
-
- {%%any comment}
-
- also has %%-marker, for example, NextMarker (PredMarker) selects it entirely,
- i.e. from "{"-bracket to "}"-bracket. It allows you to make marked comments,
- which easily may be found, modified and deleted. The feature is very useful for
- program development to maintain temporary comments.
-
- • Generate array
- • Paste data
-
- The "Generate array" menu command generates pattern for array initialization.
- For example, a command
-
- gener theArray 1 2 3 4
-
- generates a text:
-
- theArray [1,3] := {%%}; theArray [1,4] := {%%};
- theArray [2,3] := {%%}; theArray [2,4] := {%%};
-
- And a command :
-
- gener myArray -1 2
-
- generates a text:
-
- myArray [-1] := {%%};
- myArray [0] := {%%};
- myArray [1] := {%%};
- myArray [2] := {%%};
-
- After that, you will need replacing %%-markers with necessary values. To do it via
- keyboard-input you can use NextMarker and PredMarker commands. But if you have
- text file where necessary values were already written, you can use "Paste data"
- menu command.
-
- • Trivial
-
- generates Pascal source from resource description file.
- For example, see Example folder in Trivial folder :
-
- -- First of all we created test.rsrc file by ResEdit.
- -- After it we decompiled it via DeRez into test.r resources description file.
- -- And then we input test.r into Trivial, its output was test.p file.
-
- You can see the produced files test.p, test.Dict and test in 'test ƒ' folder.
-
- To remake these files by yourself:
-
- 1) Set the default directory to "Example:"
- 2) To make test.p, select the following line and press Enter.
- Trivial test.r > test.p
-
- 3) To build test, select the following line and press Enter.
- BuildProgram test ∑∑ "{Worksheet}"
-
- NOTE: To quit from test you should press Option-Command-Esc keys to force quit
- or you may add a few lines of Pascal code to realise Quite command in test.p.
-
- Trivial makes a program where
- -- resources IDs are listed in CONST list;
- -- templates of procedures to support some types (DLOG,MENU,WIND, etc.) of
- the resources are introduced;
- -- some other templates for standard procedures such as Mac managers
- initialisation and event loop, program header and program body are appended;
- etc.
-
- To generate a name, Trivial gets comment for resource from the resource
- description. So, to provide readable code, you should write comments for each of
- resources. Trivial ignores any character, which is not appropriated for
- identifier, adds letter prefix if resource comment begins from digit and so on.
- But if you dislike a number of such names you are able to use test.Dict that is
- dictionary file for renaming by Canon MPW command. To generate procedure
- templates Trivial uses, pattern files :
-
- MainLoop.Trivial
- MakeMenu.Trivial
- MenuComm.Trivial
- Uses.Trivial
-
- which look like well-known examples from Inside Macintoch. You can modify these
- files to get necessary result of generation. Also, there are another goodies to
- simplify your programming work. For example, Trivial copies Uses template with
- alphabetical list of standard units, you can simply uncomment the necessary of
- them. You can add names of your own units to Uses.Trivial file, etc.
-
- Trivial inserts placeholders (%%-markers) where programmer should insert or
- modify source code. However, in some cases the generated program pattern may be
- compiled, linked and executed successfully (for example, run the test application,
- which was built by test.make file, from test.p gotten from Trivial's output as
- is). Of course, the test does not make any useful works -- it's pattern only,
- but it's valuable pattern -- it runs without run-time errors!
-
- There are many options to control generation. By default Trivial generates the
- most complete source, but for some tasks, for example, when your program has been
- written already and you need to insert there additional constant list, the full
- text generation may be too redundant -- too large parts of the text you would
- erase by hand. In similar cases you can suppress generation of the parts by
- option's setting. To help your orientation -- which option defines which part
- generation, the parts of generated source begins from comments like this:
-
- {%% Generation option: -i}
-
- NOTE : The number of resources may be used for generation is very restricted
- for current version of Trivial (Not more 20 resources in resource file is possible).
- Next version will be free from this limitation.
-
- -----------------------------------------------------------
-
- About the author.
-
- Michael Trofimov is a computer scientist, chemist and programmer. He works in
- Lab of Computer Chemistry, N.D.Zelinsky Institute of Organic Chemistry of
- Academy of Sci of Russia. Also he makes independent researches and commercial
- programs development.
-
- He works 15 years in computer areas, among his works:
-
- -- Real-time system for ESR spectroscopy;
- -- Scientific program EDIP, to solve index-property problem for organic
- compounds;
- -- Algorithms for applied tasks of graph-theory;
-
- -- Graphics Library for Extended Pascal compiler,
- (Visible Software Co., DE, USA; Prospero Software Co. UK);
- -- Dr. Pascal integrated environment porting -- from IBM PC to Mac, Mac oriented
- language sensitive editor and interface of Dr. Pascal (Visible Software);
-
- etc. (see also 'Other MT2 software' file).
-
- He is author of more than 50 papers in Russian and international journals (First
- Class; Byte; J.of Pascal, Ada & Modula-2; J.of Mathematical Chemistry; etc.)
-
- The MT2ToolKit was planned as accumulation of author's experience of
- methods to solve tasks of practical programming. Author uses it permanently in
- his works, and so consequently improves and develops it.
-
-
- -----------------------------------------------------------
-
-
-
-